import {BasicColumn, FormSchema} from '/@/components/Table';
import {listAllPayIfDefine} from '../payIfDefine/payIfDefine.api';

export const columns: BasicColumn[] = [
  {
    title: '商户号',
    width: 100,
    dataIndex: 'mchNo',
  },
  
  {
    title: '应用ID',
    width: 120,
    dataIndex: 'appId',
  },

  {
    title: '支付接口',
    width: 120,
    dataIndex: 'ifCode',
  },

  {
    title: '下载时间',
    width: 100,
    dataIndex: 'createdAt',
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'mchNo',
    label: '商户号',
    component: 'Input',
    // colProps: {span: 6},
  },
  {
    field: 'appId',
    label: '应用ID',
    component: 'Input',
    // colProps: {span: 6},
  },
  {
    label: '支付接口',
    field: 'ifCode',
    component: 'ApiSelect',
    componentProps: {
      api: listAllPayIfDefine,
      resultField: 'data',
      labelField: 'ifName',
      valueField: 'ifCode',
    },
    // colProps: {span: 6},
  },
  {
    field: 'fieldTime',
    component: 'RangePicker',
    label: '下载时间',
    componentProps: {
      valueType: 'Date',
    },
    colProps: { span: 12},
  },
];

export const downloadFormSchema: FormSchema[] = [
  {
    field: 'mchNo',
    label: '商户号',
    required: true,
    component: 'Input',
    // colProps: {span: 6},
  },
  {
    field: 'appId',
    label: '商户应用',
    required: true,
    component: 'Input',
    // colProps: {span: 6},
  },
  {
    field: 'billDate',
    label: '账单日期',
    colProps: {span: 24},
    component: 'DatePicker',
    required: true,
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    label: '支付接口',
    field: 'ifCode',
    required: true,
    component: 'ApiSelect',
    colProps: {span: 24},
    componentProps: {
      api: listAllPayIfDefine,
      resultField: 'data',
      labelField: 'ifName',
      valueField: 'ifCode',
    },
  }
]
